#ifndef ST_SERVER_H_INCLUDED
#define ST_SERVER_H_INCLUDED

#include "sys_socket.h"
#include "thread.h"
class STSockHolder;
class STWaiterThread;

class STServer: public Thread
{
public:
    STServer(unsigned int port);
    virtual ~STServer();

    void run();
    void stop();
    void sendMsg(const void* msg, unsigned int msgLen);
    virtual bool handleMsg();
    virtual STSockHolder* newSockHolder(int sock);

    STWaiterThread* getWaiterThread();
protected:
    STWaiterThread* m_waiterThread;
    int m_serverSock;
    int m_msgSock;
    sockaddr_in m_msgSockAddr;
};

#endif // ST_SERVER_H_INCLUDED
